import { connect } from 'react-redux'
import {loadData,succulentData} from './actionCreator'

const mapStateToProps = (state) => {
    // console.log(state)
    return {
        data: state.data,
        succulent: state.succulent
    }
}

const mapDispatchToProps = (dispatch, ownProps) => {
    return {
        loaddata: () => {
            dispatch(loadData())
        },
        succulentdata: () => {
            dispatch(succulentData())
        }
    }
}

export default connect(mapStateToProps, mapDispatchToProps)